package com.brzjomo.jomosadventure.init;

import com.brzjomo.jomosadventure.JomosAdventure;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
import net.minecraft.util.registry.RegistryKey;
import net.minecraft.world.gen.YOffset;
import net.minecraft.world.gen.decorator.RangeDecoratorConfig;
import net.minecraft.world.gen.feature.ConfiguredFeature;
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.OreFeatureConfig;
import net.minecraft.world.gen.heightprovider.UniformHeightProvider;

public class ModFeatures {
    // Ore Registry Key
    public static final RegistryKey<ConfiguredFeature<?, ?>> SILVER_ORE_KEY_OVERWORLD = RegistryKey.of(Registry.CONFIGURED_FEATURE_KEY,
            new Identifier(JomosAdventure.MOD_ID, "silver_ore_overworld"));

    // Ore Key List
    public static final RegistryKey[] ORE_KEY_LIST_OVERWORLD = {SILVER_ORE_KEY_OVERWORLD};

    // Ore Config
    public static final ConfiguredFeature<?, ?> SILVER_ORE_CONFIG_OVERWORLD = Feature.ORE
            .configure(new OreFeatureConfig(
                    OreFeatureConfig.Rules.BASE_STONE_OVERWORLD,
                    ModBlocks.SILVER_ORE_BLOCK.getDefaultState(),
                    5)) // vein size
            .range(new RangeDecoratorConfig(
                    UniformHeightProvider.create(YOffset.aboveBottom(0), YOffset.fixed(32))
            ))
            .spreadHorizontally()
            .repeat(8); // number of veins per chunk

    // Ore Config List
    public static final ConfiguredFeature<?, ?>[] ORE_CONFIG_LIST_OVERWORLD = {SILVER_ORE_CONFIG_OVERWORLD};

}
